<?php 

require ( "../includes/config.php" );
require ( "../includes/CGI.php" );
require ( "../includes/SQL.php" );

$cgi = new CGI ();
$sql = new SQL ( $DBusername, $DBpassword, $server, $database );

if ( ! $sql->isConnected () )
{
  die ( $DatabaseError );
}

require ( "includes/Auth.php" );
$auth = new Auth ( $cgi, $sql, $admin_table );

$loggedOut = FALSE;

if ( $auth->getUserId () )
{
  $loggedOut = TRUE;
  $auth->logout ();
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>Property Admin Logout</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
<table width="760" border="0" align="center" cellpadding="1" cellspacing="0"> 
<tbody> 
<tr> 
<td bgcolor="#333333"> <?PHP include "header.php"; ?>
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="760"> 
<tbody> 
<tr> 
<td colspan="4"> 
<table width="90%" align="center" cellpadding="0" cellspacing="0"> 
<tr> 
<td valign="top"> 
<h2 align="left"><img src="images/spacer.gif" height="10" width="15" />Voc&ecirc; saiu da Administra&ccedil;&atilde;o do Site </h2> 
<?php
if ( $loggedOut )
{
?>
<br />
<br />
<p align="center"><b>VOC&Ecirc; EST&Aacute; DESCONECTADO!</b></p>
<p align="center"><a href="index.php">Clique aqui para entrar novamente.</a></p>
<?php
}
else
{
?>
<br /><br /><br /><p align="center"> Voc&ecirc; n&atilde;o est&aacute; autenticado ainda! </p>
<br />
<p align="center">Por favor, <a href="index.php"><strong>clique aqui </strong></a> para entrar.</p>
<br /><br />
<?php
  }
  
?>
<br />
<br />
<br /></td> 
</tr> 
</table> </td> 
</tr> 
</tbody> 
</table> </td> 
</tr> 
</tbody> 
</table> <?PHP include "footer.php"; ?>
</body>
</html>
